package chapter8JVM_excute;

//静态分配 因为方法的调用是在编译器来进行链接的也就是字面量 所以只能通过声明的静态类型而不是实际类型调用方法
public class P83_1 {

    static abstract class Human{}
    static class Man extends Human{}
    static class Woman extends Human{}

    public  void sayHello(Human human){
        System.out.println("human");
    }
    public  void sayHello(Man human){
        System.out.println("Man");
    }
    public  void sayHello(Woman human){
        System.out.println("Woman");
    }
    public static void main(String[] args) {
        P83_1 p = new P83_1();
        Human man = new Man();
        Human woman = new Woman();
        p.sayHello(man);
        p.sayHello(woman);
    }
}
